def int2complement(a, len=32):
    ret = ""
    for i in range(len - 1, -1, -1):
        if (a >> i) & 1:
            ret += "1"
        else:
            ret += "0"
    return ret


a, b = map(int, input().strip().split())
print(int2complement(a & b))
print(int2complement(a | b))
print(int2complement(a ^ b))
